package com.f.eva.tools.demo.git;

import org.eclipse.jgit.api.Git;
import org.eclipse.jgit.api.errors.GitAPIException;
import org.eclipse.jgit.transport.UsernamePasswordCredentialsProvider;

import java.io.File;

public class GitDemo {

    public static void main(String[] args) {

        try {
            Git.cloneRepository()
                    .setURI("https://gitee.com/xxx.git")
                    .setBranch("feature")
                    .setDirectory(new File("D:\\test\\"))
                    .setCredentialsProvider(new UsernamePasswordCredentialsProvider("xxx", "xx"))
                    .call();
        } catch (GitAPIException e) {
            e.printStackTrace();
        }
    }

}
